home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT8 / BLINK.ASM next >
Encoding:
Assembly Source File  |  1993-05-10  |  2.9 KB  |  77 lines

  1. ;**********************************************************************
  2. ;
  3. ;  Program Blink ( Chapter 8 )
  4. ;
  5. ;  Dialog INPUT/OUTPUT system for PC's screen.             Version  1.1
  6. ;
  7. ;  Subroutine for switching screen blinking/intensity attribute
  8. ;
  9. ;  Author: A.I.Sopin   Voronezh, Russia   1990 --- 1992
  10. ;  ------
  11. ;
  12. ;  Call from Assembler programs:
  13. ;
  14. ;       Call BLINK
  15. ;
  16. ;  Parameters passed through the AL registers:
  17. ;
  18. ;  AL  = 0 - intensity mode  (highlighted background)
  19. ;
  20. ;  AL  = 1 - blinking mode   (dark background - DOS default mode)
  21. ;
  22. ;  External subroutines required:
  23. ;  VidTyp
  24. ;
  25. ;**********************************************************************
  26.  
  27. EXTRN   VIDTYP : FAR
  28.  
  29. .MODEL  SMALL
  30. .CODE
  31. BLINK   PROC    FAR
  32.         PUBLIC  BLINK
  33.         push    ax
  34.         push    bx
  35.         push    cx
  36.         push    dx
  37.         push    es
  38. ;----------------------------------------------------------
  39. ;  The monitor type determining (MDA, CGA, EGA, ...)
  40.         mov     ch,al                   ;  Read input parameter
  41.         push    cx                      ;  Next call will destroy AX, BX, CX
  42.         Call    VIDTYP                  ;  Determining adapter type.
  43.                                         ;    result in AL
  44.         pop     cx                      ;  Restore input parameter (CX)
  45.         cmp     al,1                    ;  Is it CGA ?
  46.         jl      Exit                    ;  If MDA/HGC - exit
  47.         je      CGA                     ;  Process CGA
  48. ;  Toggle blinking for EGA and VGA adapters (INT 10h, AH=10h)
  49. EGA:    mov     ah,10h                  ;  Function 10h
  50.         mov     al,3                    ;  Subfunction 03 - toggle intensity
  51.         xor     bl,bl                   ;  BL = 0 - intensity
  52.         and     ch,ch                   ;  Check input parameter
  53.         jz      Int10h                  ;  If 0 - call BIOS video service
  54.         mov     bl,1                    ;  BL = 1 - blinking
  55. Int10h: int     10h                     ;  BIOS video service call
  56.         jmp     short Exit              ;  Leave the profgram
  57. ;  Toggle blinking for CGA using hardware
  58. CGA:    xor     ax,ax                   ;
  59.         mov     es,ax                   ;  0:[465h] - BIOS  Video Data Area
  60.         mov     al,es:[465h]            ;  This is the previosly Video Mode
  61.         or      al,20h                  ;  This constant stands for BLINKING
  62.         cmp     ch,1                    ;  Check input parameter
  63.         je      Out3D8                  ;  If 1 perform output into the port
  64.         and     al,0DFh                 ;  This constant stands for INTENSITY
  65. Out3D8: mov     dx,3D8h                 ;  Port 3D8h -
  66.         out     dx,al                   ;  Toggle intensity mode
  67. ;----------------------------------------------------------
  68. ;  Restore registers and exit
  69. Exit:   pop     es
  70.         pop     dx
  71.         pop     cx
  72.         pop     bx
  73.         pop     ax
  74.         RETF
  75. BLINK   ENDP
  76.         END
  77.